<template>
  <div class="user">
    <ul class="menu">
      <li>
        <router-link to="/user/order"> 我的资料</router-link>
      </li>
      <li>
        <router-link to="/user/info"> 我的订单</router-link>
      </li>
    </ul>
    <div class="main">
      <div class="pos">
        <span>xx，欢迎您！<button @click="quit">退出</button></span>
        <p>当前位置:
          <router-link to="item.path"
                       v-for="(item,index) in $route.matched"
                       :key="index">{{item.meta.title}}
            <span v-if="index !== $route.matched.lenght-1">&gt;</span>
          </router-link>
        </p>
      </div>
      <div class="content">
        <!-- 5 二級路由路口 -->
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      username: localStorage.getItem('heima-login')
    }
  },
  methods: {
    quit () {
      localStorage.removeItem('heima-login')
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped>
</style>
